package com.sharemarking.wa.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sharemarking.wa.common.entity.WasteType;
import com.sharemarking.wa.platform.dto.wasteType.WasteTypeListDto;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author dxy
 */
@Repository
public interface WasteTypeMapper extends BaseMapper<WasteType> {

    @Select("SELECT id AS wasteTypeId,name AS wasteTypeName FROM wa_waste_type ORDER BY create_date")
    List<WasteTypeListDto> getWasteTypeList();

    @Select("SELECT id AS wasteTypeId,name AS wasteTypeName FROM wa_waste_type WHERE name like concat('%',#{searchStr},'%')")
    List<WasteTypeListDto> getWasteTypeListByName(String searchStr);

}
